﻿using System;
class NthCatalanNumber
{
    static void Main()
    {
        Console.WriteLine("Please, enter a number");
        decimal n = decimal.Parse(Console.ReadLine());
        decimal product = 1;

        for (decimal i = 2; i <= n; i++) //using another formula for Catalan numbers, see the third part of the formula on the top here: http://en.wikipedia.org/wiki/Catalan_number 
        {
            product *= ((n+i)/i);
            
        }
        Console.WriteLine("Catalan number {0} is {1}",n ,product);
    }
}
